--- libsdl-sge-030809dfsg.orig/Makefile.conf
+++ libsdl-sge-030809dfsg/Makefile.conf
@@ -11,6 +11,7 @@
 # Compilers (C and C++)
 CC=gcc
 CXX=g++
+PKG_CONFIG?=pkg-config
 
 # Make sure sdl-config is available
 HAVE_SDL =$(shell if (sdl-config --version) < /dev/null > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
@@ -36,15 +37,15 @@
 
 
 # Is freetype-config available?
-HAVE_FT =$(shell if (pkg-config --modversion freetype2) < /dev/null > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
+HAVE_FT =$(shell if ($(PKG_CONFIG) --modversion freetype2) < /dev/null > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
 ifeq ($(HAVE_FT),n)
   USE_FT = n
 endif
 
 ifneq ($(USE_FT),n)
   USE_FT = y
-  SGE_LIBS +=$(shell pkg-config freetype2 --libs)
-  FT_CFLAGS =$(shell pkg-config freetype2 --cflags)
+  SGE_LIBS +=$(shell $(PKG_CONFIG) freetype2 --libs)
+  FT_CFLAGS =$(shell $(PKG_CONFIG) freetype2 --cflags)
 endif
 
 
--- libsdl-sge-030809dfsg.orig/Makefile
+++ libsdl-sge-030809dfsg/Makefile
@@ -11,20 +11,21 @@
 
 OBJECTS=sge_surface.o sge_primitives.o sge_tt_text.o sge_bm_text.o sge_misc.o sge_textpp.o sge_blib.o sge_rotation.o sge_collision.o sge_shape.o
 
-all:	config $(OBJECTS) 
+all:	sge_config.h $(OBJECTS) 
 	ar rsc libSGE.a $(OBJECTS)
 
 $(OBJECTS):	%.o:%.cpp %.h   #Each object depends on thier .cpp and .h file
 	$(CXX) $(CFLAGS) -c $<
 
-shared: all
+shared: libSGE.so
+libSGE.so: sge_config.h $(OBJECTS)
 	$(CXX) $(CFLAGS) $(LDFLAGS) -Wl,-soname,libSGE.so.$(API_VER) -fpic -fPIC -shared -o libSGE.so $(OBJECTS) $(LIBS)
 
 shared-strip:	shared
 	@strip libSGE.so
 
 # Building a dll... I have no idea how to do this, but it should be something like below.
-dll:	config $(OBJECTS)
+dll:	sge_config.h $(OBJECTS)
 	dlltool --output-def SGE.def $(OBJECTS)
 	dllwrap --driver-name $(CXX) -o SGE.dll --def SGE.def --output-lib libSGE.a --dllname SGE.dll $(OBJECTS) $(LIBS)
 
@@ -34,7 +35,8 @@
 clean:
 	rm -f *.o *.so *.so.* *.a *.dll *.def
 
-config:
+config:sge_config.h
+sge_config.h:
 	@echo "/* SGE Config header (generated automatically) */" >sge_config.h
 	@echo "#define SGE_VER $(SGE_VER)" >>sge_config.h	
 ifeq ($(C_COMP),y)
