Overhauled all the makefiles