diff --git a/build/unix/makelib.sh b/build/unix/makelib.sh
index bbc095b0bd598119724d5864a84c3cfdd47061b4..2ec4080ac7c5a3c8c1eee4d62e8fd3e0734a778b 100755
--- a/build/unix/makelib.sh
+++ b/build/unix/makelib.sh
@@ -51,9 +51,9 @@ if [ "x$EXPLICIT" = "xyes" ]; then
           fi
       fi
       if [ $LIB != "lib/libCore.$soext" ]; then
-         EXPLLNKCORE="-Llib -lCore -lCint $NEEDREFLEX"
+         EXPLLNKCORE="-Llib $NEEDREFLEX -lCore -lCint"
       else
-         EXPLLNKCORE="-Llib -lCint $NEEDREFLEX"
+         EXPLLNKCORE="-Llib -lCint"
       fi
    fi
 fi
diff --git a/build/win/makelib.sh b/build/win/makelib.sh
index 6bae496a69cbd75954636fa3852753cacdba03f5..de135662f84bd29a1987f5a55294e185af044da6 100755
--- a/build/win/makelib.sh
+++ b/build/win/makelib.sh
@@ -60,22 +60,19 @@ if [ "$R__PLATFORM" = "win32" ]; then
               lib/${name}.exp $R__EXTRA $syslibs"
       elif [ "$R__LIB" = "lib/libCintex.dll" ]; then
          cmd="$R__LD $R__SOFLAGS $R__LDFLAGS -o bin/${name}.dll $R__OBJS \
-              lib/${name}.exp lib/libReflex.lib $R__EXTRA $syslibs"
+              lib/${name}.exp lib/libCore.lib lib/libReflex.lib \
+              lib/libCint.lib $R__EXTRA $syslibs"
       elif [ "$R__LIB" = "lib/libCore.dll" ]; then
-         if [ "$(bin/root-config --dicttype)" != "cint" ]; then
-             needReflex="lib/libCintex.lib lib/libReflex.lib"
-         fi
          cmd="$R__LD $R__SOFLAGS $R__LDFLAGS -o bin/${name}.dll $R__OBJS \
-              lib/${name}.exp lib/libCint.lib $needReflex\
-              $R__EXTRA $syslibs WSock32.lib \
-              Oleaut32.lib Iphlpapi.lib"
+              lib/${name}.exp lib/libCint.lib \
+              $R__EXTRA $syslibs WSock32.lib Oleaut32.lib Iphlpapi.lib"
       else
          if [ "$(bin/root-config --dicttype)" != "cint" ]; then
              needReflex="lib/libCintex.lib lib/libReflex.lib"
          fi
          cmd="$R__LD $R__SOFLAGS $R__LDFLAGS -o bin/${name}.dll $R__OBJS \
-              lib/${name}.exp $R__EXTRA lib/libCore.lib \
-              lib/libCint.lib $needReflex \
+              lib/${name}.exp $R__EXTRA \
+              $needReflex lib/libCore.lib lib/libCint.lib \
               $syslibs"
       fi
       echo $cmd
diff --git a/cintex/Module.mk b/cintex/Module.mk
index 6bb8c0ec94ffc9174de8bfcfd3235dbadadebbc6..b346f1dc7bf2308d15d577ec83b7bd043e2a7092 100644
--- a/cintex/Module.mk
+++ b/cintex/Module.mk
@@ -63,7 +63,8 @@ include/Cintex/%.h: $(CINTEXDIRI)/Cintex/%.h
 %.pyc: %.py;    python -c 'import py_compile; py_compile.compile( "$<" )'
 %.pyo: %.py;    python -O -c 'import py_compile; py_compile.compile( "$<" )'
 
-$(CINTEXLIB):   $(CINTEXO) $(CINTEXPY) $(CINTEXPYC) $(CINTEXPYO) $(ORDER_) $(MAINLIBS) $(CINTEXLIBDEP)
+$(CINTEXLIB):   $(CINTEXO) $(CINTEXPY) $(CINTEXPYC) $(CINTEXPYO) \
+                $(ORDER_) $(subst $(CINTEXLIB),,$(MAINLIBS)) $(CINTEXLIBDEP)
 		@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)"      \
 		"$(SOFLAGS)" libCintex.$(SOEXT) $@ "$(CINTEXO)" \
 		"$(CINTEXLIBEXTRA)"