# Remove CGO flag, and make build options match the same format
--- a/makefile
+++ b/makefile
@@ -1,6 +1,6 @@
 COPY := cp -p
 GO_BUILD_NOPIE := CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath
-GO_BUILD_PIE := go build -ldflags "-s -w -extldflags=-Wl,-z,now,-z,relro,-z,defs" -buildmode=pie -trimpath
+GO_BUILD_PIE := go build -ldflags "-s -w -extldflags=-Wl,-z,now,-z,relro,-z,defs" -buildmode=pie -trimpath
 GO_BUILD_STATIC_PIE := go build -ldflags '-linkmode external -s -w -extldflags "-static-pie -Wl,-z,relro,-z,defs"' -buildmode=pie -trimpath  -tags 'osusergo netgo static_build'
 GO_BUILD_DEBUG := go build -gcflags "all=-N -l"
 
@@ -34,7 +34,7 @@
 	  github.com/aws/amazon-ssm-agent/agent/... \
 	  github.com/aws/amazon-ssm-agent/core/...
 
-build:: build-linux build-freebsd build-windows build-linux-386 build-windows-386 build-arm build-arm64 build-darwin-amd64 build-darwin-arm64
+build:: build-linux-amd64 build-freebsd build-windows build-linux-386 build-windows-386 build-linux-arm build-linux-arm64 build-darwin-amd64 build-darwin-arm64
 
 prepack:: cpy-plugins copy-win-dep prepack-linux prepack-linux-arm64 prepack-linux-386 prepack-windows prepack-windows-386
 
@@ -149,11 +149,11 @@
 # Pre-defined recipes for various supported builds:
 
 # Production 64bit linux binaries are built using GO_BUILD_STATIC_PIE
-.PHONY: build-linux
-build-linux: GOARCH=amd64
-build-linux: GOOS=linux
-build-linux: GO_BUILD=$(GO_BUILD_PIE)
-build-linux: build-any-amd64-linux
+.PHONY: build-linux-amd64
+build-linux-amd64: GOARCH=amd64
+build-linux-amd64: GOOS=linux
+build-linux-amd64: GO_BUILD=$(GO_BUILD_PIE)
+build-linux-amd64: build-any-amd64-linux
 
 .PHONY: build-linux-debug
 build-linux-debug: clean pre-release
@@ -193,7 +193,7 @@
 .PHONY: build-linux-386
 build-linux-386: GOOS=linux
 build-linux-386: GOARCH=386
-build-linux-386: GO_BUILD=$(GO_BUILD_NOPIE)
+build-linux-386: GO_BUILD=$(GO_BUILD_PIE)
 build-linux-386: build-any-linux-386
 
 .PHONY: build-windows-386
@@ -205,17 +205,17 @@
 build-windows-386: GO_WORKER_SRC_TYPE=windows
 build-windows-386: build-any-windows-386
 
-.PHONY: build-arm
-build-arm: GOOS=linux
-build-arm: GOARCH=arm
-build-arm: GO_BUILD=GOARM=6 $(GO_BUILD_NOPIE)
-build-arm: build-any-arm
+.PHONY: build-linux-arm
+build-linux-arm: GOOS=linux
+build-linux-arm: GOARCH=arm
+build-linux-arm: GO_BUILD=GOARM=6 $(GO_BUILD_PIE)
+build-linux-arm: build-any-linux-arm
 
-.PHONY: build-arm64
-build-arm64: GOOS=linux
-build-arm64: GOARCH=arm64
-build-arm64: GO_BUILD=$(GO_BUILD_NOPIE)
-build-arm64: build-any-linux-arm64
+.PHONY: build-linux-arm64
+build-linux-arm64: GOOS=linux
+build-linux-arm64: GOARCH=arm64
+build-linux-arm64: GO_BUILD=$(GO_BUILD_PIE)
+build-linux-arm64: build-any-linux-arm64
 
 .PHONY: copy-src
 copy-src:
