I'm thinking of a plane or large wood chisel. Just mark the 2 x 4 at the bottom and find the high point . Whittle at it until you find another. You could just score it briefly with a knife to do the edges. Jig or recip? I think neither.
Anchoring:
There are some cement fasteners on the website referenced later that anchor into cement and provide a female tapped hole where you could then insert a piece of all thread. ANything is possible, even mounting a 2 x for the wrong way flush with the rear of the wall and outting a hole in the middle of it. You'd have complete adjustibility. Let the hole have some slop, so things can move.
Something like this in the back wall.
TITEN HD® Rod Hanger ~ Simpson Strong-Tie Anchor Systems® especially since you said stuff is uneven.
Say, drill a hole near the center of a stud opening in the wall behind to accept the cement to all thread. Insert the all thread and transfer to a 2 x 4 mounted correctly. Then use that to drill a hole in the widest face. Rotate 90 deg with the long side against the back wall.
Use washers and double nuts especially against the back wall.
Put a washer and a nut in the back and also in the front so you'd be able to adjust it any distance from the wall.
I don't know if you nned it, because I can't see what you have although you can post a picture directly to this site using "go advanced/manage attachments".
Insert the all thread through the hole in the 2 x 4, say centered between the joist
Bracing: Screws are better and so is the strongtie fasteners.
The all-thread fasteners, probably 1/2" into masonary would give you a totally adjustable wall in the directions that matter.
Remember, the cabinets are going to mount on a stud and will be mostly be pulling down so the force, if anything will try to move the bottom 2 x 4 toward the back wall, so a few 2 x 4's at the bottom would prevent that shift.
Fastening the side members is what gives the frame support and the fasteners are then subject to shear. It takes a lot more effort to shear a bolt than it would to pull off a nut. Again, not sure what you have.
Insulate the all thread to prevent condensation unless you have other plans. You could even use foam pipe insulation.
Home depot sells this brand and even this particular product to put the frame together.
http://www.strongtie.com/ftp/catalogs/c-2009/C-2009.pdf on page 170, #RTA2Z or some of the other connectors. Remember to get their screws.
They definitely add stability. Just bought a few last week.
Make sense?