Clean up STM build by moving common defs to Makefile.defs