--- examples/Makefile.orig	Thu Sep 21 15:25:22 2006
+++ examples/Makefile	Thu Sep 21 20:34:29 2006
@@ -8,10 +8,10 @@
 
 # Set correct variables and paths
 CIMGVER = 1.16
-CC      = g++
-X11PATH = /usr/X11R6
-CFLAGS  = -Wall -W -ansi -pedantic -ffast-math -I$(X11PATH)/include
-LDFLAGS = -L$(X11PATH)/lib -lm -lpthread -lX11
+CC      = $(CXX)
+#X11PATH = /usr/X11R6
+#CFLAGS  = -Wall -W -ansi -pedantic -ffast-math -I$(X11PATH)/include
+#LDFLAGS = -L$(X11PATH)/lib -lm -lpthread -lX11
 
 # Uncomment to enable fast image display, using the XSHM library.
 XSHM_FLAGS = -Dcimg_use_xshm -lXext 
@@ -59,7 +59,7 @@
 	@echo
 	@echo "** Compiling '$* ($(CIMGVER))' with '`$(CC) -v 2>&1 | grep version`'"
 	@echo
-	$(CC) -o $* $< $(CFLAGS) $(LDFLAGS) $(ARCHFLAGS)
+	$(CC) -o $* $< $(CPPFLAGS) -Wall -ansi -pedantic -ffast-math  -I$(X11PATH)/include -lX11 -L$(X11PATH)/lib $(LDFLAGS)
 menu:
 	@echo
 	@echo "CImg Library $(CIMGVER) : Examples"
@@ -84,7 +84,7 @@
 all: $(CIMGFILES)
 
 clean:
-	rm -f *.exe *~ $(CIMGFILES)
+	rm -f *.exe *~ $(CIMGFILES) Makefile.orig
 
 # Linux/Mac OSX targets
 linux:
