ELIBSDIR :=
ELIBS := Reve
-PACKBLIBS := $(ROOTCLIBS) -lTreePlayer -lGeomPainter -lGed -lRGL $(SYSLIBS)
+PACKBLIBS := $(ROOTCLIBS) -lTreePlayer -lGeomPainter -lGed \
+ -L$(shell root-config --libdir)/$(dir $(shell root-config --version)) -lRGL \
+ $(SYSLIBS)
ifeq (macosx,$(ALICE_TARGET))
-PACKLDFLAGS:=$(LDFLAGS) $(ELIBSCPP:%=-Wl,-u,_G__cpp_setupG__%)
-# On Mac OS X gcc we need GL
-ELIBS+=GL
+# On Mac OS X gcc we need GL and GLU
+ELIBS+=GL GLU
ELIBSDIR+=/usr/X11R6/lib/
endif