changing the makefile and modularizing it