refactored the Makefile code