Select the bulding you want to build and then click on the grey building foundation to build it. Alternatively, you can use the hotkeys (the numbers in green) to select your building, and to use the weapon. Pressing escape will exit any menus, building, or weapon currently on screen.