refactor makefile with env variables