More configury / build system updates

A series of patches that continue to improve the configure/build system.

Each one is a small enough patch that should be easily understandable by itself.
Are you sure that this isn't needed?  I've just had problems in past projects where this wasn't there which resulted in build issues (either from tarballs or other - don't recall).