--- Makefile	2003-09-28 10:33:24.000000000 +0000
+++ Makefile	2008-05-18 19:05:12.000000000 +0000
@@ -1,24 +1,28 @@
-CC     = gcc
+CC     ?= gcc
 LIBS   = -lpng -lz -lm
-CFLAGS = -g -O2 -W -Wall -DPNG_SETJMP_NOT_SUPPORTED
-
+CFLAGS ?= -g -O2 -W -Wall
+CFLAGS += -DPNG_SETJMP_NOT_SUPPORTED
+LDFLAGS =
 INSTALL = /usr/bin/install
 INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
 INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
 INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
 
 DESTDIR =
-PREFIX = /usr/local
+PREFIX = /usr
 BINDIR = ${PREFIX}/bin
 MANDIR = ${PREFIX}/share/man
 
 fblogo:	fblogo.c
-	$(CC) -o fblogo $(CFLAGS) $(INCLUDES) $(LIBS) fblogo.c
+	$(CC) -o fblogo $(CFLAGS) $(INCLUDES) $(LDFLAGS) $(LIBS) fblogo.c
 
 clean::
 	-rm -f *.o fblogo
 
 install:
+	mkdir -p ${DESTDIR}${PREFIX}
+	mkdir -p ${DESTDIR}${BINDIR}
+	mkdir -p ${DESTDIR}${MANDIR}/man1
 	${INSTALL_PROGRAM} fblogo   ${DESTDIR}${BINDIR}
 	${INSTALL_SCRIPT} fblogo_patch   ${DESTDIR}${BINDIR}
 	${INSTALL_FILE}    fblogo.1 ${DESTDIR}${MANDIR}/man1
