make Makefile more compatible with multiple builds
config/state files fixes