--- Makefile.orig	2011-12-29 23:12:52.000000000 +0100
+++ Makefile	2013-09-28 11:45:51.000000000 +0200
@@ -2,7 +2,7 @@
 #To make a system-wide install add DATADIR=/dir/to/data/ and BINDIR=/dir/to/bin/ to the make command
 #To compile with OpenGL scaling support, add WITH_OPENGL=true to the make command.
 
-CC = gcc
+CC ?= gcc
 LD = $(CC)
 STRIP = strip
 
@@ -16,9 +16,9 @@
 
 DEFS = $(PUF) -DDATADIR="\"$(DATADIR)\""
 
-INCS =  -I. -I/usr/include -I/usr/include/SDL
+CPPFLAGS+=	-I/usr/local/include
+LDFLAGS+=	-L/usr/local/lib
 
-LDFLAGS=$(CFLAGS)
 LIBS = -lSDL -lSDL_image -lSDL_mixer -lpng -lm -lz -lpthread
 
 #Are we compiling with gl?
@@ -32,7 +32,7 @@
 levelselector.o leveleditor.o particle.o pack.o settings.o stats.o strings.o\
 mbrowse.o teleport.o credits.o waveimg.o userfiles.o
 
-MYCC = $(CC) $(CFLAGS) $(INCS) $(DEFS)
+MYCC = $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS)
 
 ########################################################################
 
@@ -46,12 +46,12 @@
 	$(MYCC) -c $< -o $@
 
 install:
-	install -d -D -m 755 "$(DESTDIR)$(BINDIR)"
-	install -D -m 755 "$(TARGET)" "$(DESTDIR)$(BINDIR)"
-	install -d -D -m 755 "$(DESTDIR)$(DATADIR)"
+	install -d -m 755 "$(DESTDIR)$(BINDIR)"
+	install -m 755 "$(TARGET)" "$(DESTDIR)$(BINDIR)"
+	install -d -m 755 "$(DESTDIR)$(DATADIR)"
 	cp -R data "$(DESTDIR)$(DATADIR)"
 	cp -R packs "$(DESTDIR)$(DATADIR)"
-	chmod -R 755 "$(DESTIR)$(DATADIR)"
+#	chmod -R 755 "$(DESTIR)$(DATADIR)"
 
 clean:
 	rm -f *.o $(NAME)
