diff --git a/Makefile b/Makefile
index 3f6e8a93e7e2d5b86c4c9f66a8ac721fbbb3078e..4908319070ee088f6b4a5f3c8611d3491971deb4 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
 
 # Tip: Remove "-r" from the line below if you don't want to rebuild
 # from scratch every time you upgrade the kernel.
-OS=$${PIKE_BUILD_OS:-`uname -s -r -m|sed "s/ /-/g"|tr "[A-Z]" "[a-z]"|tr "/()" "___"`}
+OS=`if [ -n \"$$PIKE_BUILD_OS\" ]; then echo \"$$PIKE_BUILD_OS\"; else uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"; fi`
 
 VPATH=.
 BUILDDIR=build/$(OS)