You need to find the studs and screw a rail across.
If the studs are too far apart or if it is a paramount wall, you'll have to do something like I've just done. basically cut one side out, then put in studs and decent top plate, which is well anchored.
Actually mine was more complicated...