Makefile refactor to get idempotent builds.