diff --git a/Makefile b/Makefile
index fc6eced371594c45f884ee0bbe1917e11c80828f..6c5f6b1e9beb5a43d6adf8278076e083b16bca3b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+#use llvm by default, GNU C otherwise
+CC=$(shell which clang || which gcc)
+
 PREFIX ?= /usr
 BINDIR ?= $(PREFIX)/bin
 SYS := $(shell gcc -dumpmachine)
@@ -65,8 +68,6 @@ INCLUDES = -I.
 FLAGS2 =
 endif
 
-# this works on llvm or real gcc
-CC = clang
 
 DEFINES = 
 CFLAGS = -g -ggdb $(FLAGS2) $(INCLUDES) $(DEFINES) -Wall -O3