Tweak Makefile generation of control/version.sml.

Be more robust in the absence of git and/or working tree.
Use more robust command substitution syntax.
Add newline at end of control/version_sml.src.