Fix autotools dist support

These are the aggregate changes necessary for make check, make dist, and make distcheck to all work, at least in my environment.  The bulk of the changes are related to the need to support separated builds, especially when the source directory is read-only.

Bindings for lua, ruby, perl, and python were all generated, and I verified that all files created by a make install before the changes were created by make install after the changes; I have not, however, tested any of the bindings.