Move main cpp file in makefiles to before libraries.