Merge pull request #4 from hessu/distance

Added missing range.c + .h, missing from pull request for range stats
Don't override CFLAGS. Use cmake commands instead to specify release build