--- a/src/compile.lsp.in
+++ b/src/compile.lsp.in
@@ -1,3 +1,4 @@
+;;; @configure_input@
 ;;; This is the "makefile" file for building ECL. The purpose of this file is
 ;;;	- Compile the core of the Common-Lisp library (lsp, clos)
@@ -36,7 +37,7 @@
 ;;;   with an already installed copy of ECL.
 (setq c::*cc-flags*
-      #-msvc "@CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/h -I\"@true_srcdir@\"/gmp -I\"@true_builddir@\"/h"
+      #-msvc "@CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/h -I\"@true_srcdir@\"/gmp -I\"@true_builddir@\"/h"
       #+msvc "@CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/h -I\"@true_builddir@\"/h"
       #-msvc "~A ~A ~:[~*~;~A~] -I\"@true_builddir@\"/h~* -w -c ~S -o ~S"
@@ -46,14 +47,14 @@
       #+msvc "~A -Zi -Fe~S~* ~{~S ~} ~@?")
 (setf c::*ld-flags*
 (setf c::*ld-flags*
 ;;; * Avoid name clashes with user supplied code.
@@ -88,13 +89,13 @@
 cd tmp; ar -x ../@LIBPREFIX@lsp.@LIBEXT@;
 for i in *.@OBJEXT@; do mv $i lsp_`basename $i`; done;
 ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@ ../c/all_symbols2.@OBJEXT@; rm *.@OBJEXT@;
-ranlib ../@LIBPREFIX@ecl.@LIBEXT@'")
 ;;; We do not need the -rpath flag for the library, nor -lecl.
-(let ((c::*ld-shared-flags* #-msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @STATICLIBS@ @CLIBS@"
+(let ((c::*ld-shared-flags* #-msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @CORE_LIBS@ @LIBS@ @FASL_LIBS@"
       (c::*cc-flags* (concatenate 'string "-I@true_builddir@/c " c::*cc-flags*)))
   (c::shared-cc (compile-file-pathname "ecl" :type :dll)