fix: fatal error reported when run make build in release src (#485)

diff --git a/Makefile b/Makefile
index 92ef8b6..6809f2f 100644
--- a/Makefile
+++ b/Makefile
@@ -21,8 +21,11 @@
 LOCAL_REGISTRY="localhost:5000"
 IMAGE_TAG ?= dev
 
+GITSHA ?= "no-git-module"
+ifneq ("$(wildcard .git)", "")
+	GITSHA = $(shell git rev-parse --short=7 HEAD)
+endif
 GINKGO ?= $(shell which ginkgo)
-GITSHA ?= $(shell git rev-parse --short=7 HEAD)
 OSNAME ?= $(shell uname -s | tr A-Z a-z)
 OSARCH ?= $(shell uname -m | tr A-Z a-z)
 PWD ?= $(shell pwd)