more refactoring to Makefile.am