Refactor makefile