diff -ru simplecudd.orig/Makefile simplecudd/Makefile
--- simplecudd.orig/Makefile	2009-11-10 13:02:02.000000000 +0100
+++ simplecudd/Makefile	2013-05-22 18:17:56.000000000 +0200
@@ -4,7 +4,7 @@
 LBITS := $(shell getconf LONG_BIT)
 ifeq ($(LBITS),64)
 	# do 64 bit stuff here, like set some CFLAGS
-	FLAGS = -march=native -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
+	FLAGS = ${CFLAGS} -march=native -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8
 else
 	# do 32 bit stuff here
 	FLAGS =
@@ -19,12 +19,12 @@
 example: Example.o simplecudd.o general.o
 	@echo Making Example...
 	@echo Copyright T. Mantadelis and Katholieke Universiteit Leuven 2008
-	gcc Example.o simplecudd.o general.o $(LINKLIBS) $(LINKFLAGS) -o Example
+	$(CC) Example.o simplecudd.o general.o $(LINKLIBS) $(LINKFLAGS) -o Example
 
 problog: ProblogBDD.o simplecudd.o general.o
 	@echo Making ProblogBDD...
 	@echo Copyright T. Mantadelis, A. Kimming, B. Gutmann and Katholieke Universiteit Leuven 2008
-	gcc ProblogBDD.o simplecudd.o general.o $(LINKLIBS) $(LINKFLAGS) -o ProblogBDD
+	$(CC) ProblogBDD.o simplecudd.o general.o $(LINKLIBS) $(LINKFLAGS) -o ProblogBDD
 
 makecudd:
 	@(cd $(CUDD); \
@@ -32,7 +32,7 @@
 	make)
 
 %.o : %.c
-	gcc $(FLAGS) $(INCLUDE) $(DYNAMIC) -c $<
+	$(CC) $(FLAGS) $(INCLUDE) $(DYNAMIC) -c $<
 
 cleansimplecudd:
 	rm -rf *.o ProblogBDD Example
diff -ru simplecudd.orig/cudd-2.4.1/Makefile simplecudd/cudd-2.4.1/Makefile
--- simplecudd.orig/cudd-2.4.1/Makefile	2009-11-09 18:40:46.000000000 +0100
+++ simplecudd/cudd-2.4.1/Makefile	2013-05-22 18:18:27.000000000 +0200
@@ -50,7 +50,7 @@
 # These four are typical settings for optimized code with gcc.  The
 # last two also work with icc/ecc.
 #ICFLAGS	= -g -O6 -Wall
-ICFLAGS	= -g -O6
+ICFLAGS	= $(CFLAGS) -g -O6
 #ICFLAGS	= -g -O3 -Wall
 #ICFLAGS	= -g -O3
 
