I didn't find a possibility to attach the patch. Now it follows after here:

<verbatim>
diff -Naur -x _FOSSIL_ -x build fossil-org/Makefile.w32 fossil-src/Makefile.w32
--- fossil-org/Makefile.w32	2010-04-04 15:15:42 +0000
+++ fossil-src/Makefile.w32	2010-04-05 10:19:38 +0000
@@ -19,9 +19,13 @@
 #
 E = .exe

-#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
+#### Make a binary with all libraries statically linked.
 #
-# FOSSIL_ENABLE_SSL=1
+# FOSSIL_BUILD_STATIC = 1
+
+#### Enable HTTPS support via OpenSSL.
+#
+# FOSSIL_ENABLE_SSL = 1

 #### C Compile and options for use in building executables that
 #    will run on the target platform.  This is usually the same
@@ -41,18 +45,25 @@
 endif

 #### Extra arguments for linking the finished binary.  Fossil needs
-#    to link against the Z-Lib compression library.  There are no
-#    other dependencies.  We sometimes add the -static option here
-#    so that we can build a static executable that will run in a
-#    chroot jail.
-#
-#LIB = -lz
-#LIB = -lz -lws2_32
-LIB = -lmingwex -lz -lws2_32
+#    to link against the Z-Lib compression library and to the OpenSSL crypto
+#    libraries when FOSSIL_ENABLE_SSL is defined. There are no other
+#    dependencies.
+#
+ifdef FOSSIL_BUILD_STATIC
+  LIB += -static
+  SSLLIBS = -lssl -lcrypto -lgdi32
+else
+# SSLLIBS = -lssl32 -leay32  # OpenSSL Versions <  1.0.0
+  SSLLIBS = -lssl -lcrypto   # OpenSSL Versions >= 1.0.0
+endif
+#
 # OpenSSL:
 ifdef FOSSIL_ENABLE_SSL
-LIB += -lcrypto -lssl
+  LIB += $(SSLLIBS)
 endif
+#
+# Normal required libraries:
+LIB += -lmingwex -lz -lws2_32

 #### Tcl shell for use in running the fossil testsuite.
 #
diff -Naur -x _FOSSIL_ -x build
--- 2010-04-04 15:18:11 +0000
+++ 2010-04-05 10:42:39 +0000
@@ -114,7 +114,10 @@
   puts -nonewline " \$(OBJDIR)/$s.o"
 }
 puts "\n"
-puts "APPNAME = $name\$(E)"
+puts "APPNAME     = $name\$(E)"
+puts "TRANSLATE   = translate\$(E)"
+puts "MAKEHEADERS = makeheaders\$(E)"
+puts "MKINDEX     = mkindex\$(E)"
 puts "\n"

 puts {
@@ -126,13 +129,13 @@
 $(OBJDIR):
 	-mkdir $(OBJDIR)

-translate:	$(SRCDIR)/translate.c
+$(TRANSLATE):	$(SRCDIR)/translate.c
 	$(BCC) -o translate $(SRCDIR)/translate.c

-makeheaders:	$(SRCDIR)/makeheaders.c
+$(MAKEHEADERS):	$(SRCDIR)/makeheaders.c
 	$(BCC) -o makeheaders $(SRCDIR)/makeheaders.c

-mkindex:	$(SRCDIR)/mkindex.c
+$(MKINDEX):	$(SRCDIR)/mkindex.c
 	$(BCC) -o mkindex $(SRCDIR)/mkindex.c

 # WARNING. DANGER. Running the testsuite modifies the repository the
@@ -161,7 +164,7 @@

 clean:
 	rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h
-	rm -f translate makeheaders mkindex page_index.h headers}
+	rm -f $(TRANSLATE) $(MAKEHEADERS) $(MKINDEX) page_index.h headers}

 set hfiles {}
 foreach s [lsort $src] {lappend hfiles $s.h}
@@ -175,23 +178,23 @@
 append mhargs " \$(SRCDIR)/sqlite3.h"
 append mhargs " \$(SRCDIR)/th.h"
 append mhargs " VERSION.h"
-puts "page_index.h: \$(TRANS_SRC) mkindex"
-puts "\t./mkindex \$(TRANS_SRC) >$@"
-puts "headers:\tpage_index.h makeheaders VERSION.h"
-puts "\t./makeheaders $mhargs"
+puts "page_index.h: \$(TRANS_SRC) \$(MKINDEX)"
+puts \$(TRANS_SRC) >$@"
+puts "headers:\tpage_index.h \$(MAKEHEADERS) VERSION.h"
+puts $mhargs"
 puts "\ttouch headers"
 puts "headers: Makefile"
 puts "Makefile:"
 set extra_h(main) page_index.h

 foreach s [lsort $src] {
-  puts translate"
-  puts "\t./translate \$(SRCDIR)/$s.c >${s}_.c\n"
+  puts \$(TRANSLATE)"
+  puts \$(SRCDIR)/$s.c >${s}_.c"
   puts $s.h $extra_h($s) \$(SRCDIR)/config.h"
-  puts -o \$(OBJDIR)/$s.o -c ${s}_.c\n"
-  puts "$s.h:\theaders"
-#  puts "\t./makeheaders headers\n"
-#  puts "\t./makeheaders ${s}_.c:${s}.h\n"
+  puts -o \$(OBJDIR)/$s.o -c ${s}_.c"
+  puts
+#  puts "\t./$(MAKEHEADERS) headers\n"
+#  puts "\t./$(MAKEHEADERS) ${s}_.c:${s}.h\n"
 }
</verbatim>