make a shelf that uses three screws level
Hold the shelf in place and drive the middle fastener into the wall.  Place the level on top of the shelf and adjust using the bubble to level. Drive the other two screws into place.