Merge pull request #1086 from JoesCat/master

Various Makefile.am fixes needed while trying 'make distcheck'