autotools build improvements

This patch series contains some cleanups/improvements to configure.ac/Makefile.am.