If you want to make the building "square up", then (assuming it is possible - sometimes it isn't for more than one reason), then you have only two options.
1. Do it in camera, which may require a tilt/shift lens or a camera with movements.
2. Do it afterwards, in darkroom or Photoshop. In this case, arrange as much in camera as possible beforehand. Leave plenty of space around the building, hold the camera so as to produce the least possible distortion (in this case, get the most central part vertical, not slanting) and if necessary use a shorter focal length.
Bear I mind for reasons I won't explain that the further away from the axis a three dimensional object is, the more it will have its shape changed. This is down to simple geometry, NOT lens aberrations.