You Know the Drill
This is one of those instances where having an electric screwdriver really comes in handy. Use a drill bit that's slightly smaller than your screws or else they’ll go right through. Once you’ve got the right size, use your pencil marks as your guide, and drill far enough that you just start to break through the wood. If you go too far, your screws will be too short and won’t hold the legs.