Autotools improvements

Some not-too-smallish changes to configure.ac — the end result is a visibly faster run of ./configure.