Refactor Makefiles.