refactor Makefiles