Use version heuristics only for local builds with plain make

The doing rpm build the relative path to the spec file might not be
the same as it is in the source tree.

When doing rpm build, feed the version info to make from spec rule.
When doing local build with make, dig it from the spec file.