Made the makefile more modular.
Optimized makefile.