diff --git a/Makefile b/Makefile
index b4f9ed12a2c3112de34338e0fc81aa9ca39f87e6..32cb9cc5e8ee441770cf51532f0abf264c6807b7 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ group=$(shell id -g -n)
 
 export GOBIN=$(PWD)/bin
 
-LD_FLAGS="-w -X main.version=$(VERSION) -extldflags \"-static\""
+LD_FLAGS="-w -X main.version=$(VERSION)"
 
 # Dependency versions
 
@@ -46,6 +46,7 @@ bin/example-app:
 	@cd examples/ && go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/examples/example-app
 
 .PHONY: release-binary
+release-binary: LD_FLAGS = "-w -X main.version=$(VERSION) -extldflags \"-static\""
 release-binary: generate
 	@go build -o /go/bin/dex -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex
 	@go build -o /go/bin/docker-entrypoint -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/docker-entrypoint