Revert most Makefile.am changes to fix subdir build order