more refactoring to Makefile.am, using backticks instead of $(shell)