adds % : %.d rule to both makefile.am's