Generate version numbers for autotools builds

This is a partial fix for #890 - the build generates a version number from the `version` file if it is present, from the git tree, or falls back to a default. Also, tarballs generation will create a `version` file (and include the tools necessary to use it).

Example output:
`fish, version 2.0.0-65-gd84e64d`

I would appreciate some review before we consider merging this. Also, the Xcode build needs to be taught about the FISH_BUILD_VERSION symbol before merging.