LNAV arming criteria on the ground:
• origin runway in flight plan
• active route entered in FMC
• track of first leg within 5 degrees of runway heading
• LNAV selected prior to TO/GA.
• LNAV guidance becomes active at 50 feet AGL
Pressing TOGA gives wings level/ HDG and after rotation at 50 feet LNAV guidance would become active if the above criteria is met.
If the Air ground sensor fails ( indicated by take off page not changing to climb) the A/C thinks its still on the ground and LNAV would not be available automatically, you would need to select the active waypoint and execute in the legs page ( above 400 feet) .
VNAV climb profile would not be available unless the A/C knows the active waypoint which determines the altitude and speed profiles.