Fallback to version 'unknown' if git isn't available.
Remove unnecessary variable evaluations.

Speed isn't important here, but it cuts down from three git
invocations per run to one.
Pass the git version string to tiff2png.c when compiling.

This doesn't solve the problem of how to embed a correct
version string in published tarballs; they'll just use
the unknown version fallback. We need something more
sophisticated here.