diff --git a/Makefile b/Makefile
index 5c15f69dc4d30a6cb1962b73054553ed1a44752e..22992170aad55a0d8e34b5883682fad381e1a164 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,5 @@
 ifndef GOOS
-UNAME_S := $(shell uname -s)
-ifeq ($(UNAME_S),Darwin)
-	GOOS := darwin
-else ifeq ($(UNAME_S),Linux)
-	GOOS := linux
-else
-$(error "$$GOOS is not defined.")
-endif
+GOOS        := $(word 1, $(subst /, " ", $(word 4, $(shell go version))))
 endif
 
 MAKEFILE    := $(realpath $(lastword $(MAKEFILE_LIST)))