cmake: failed to get git version

* add a fallback when the git version can't be fetched

Close issue #122