The problem is getting all the correct libraries and include files when compiling with gcc on windows. My advice: install an IDE such as wxDev-C++. That will make things much easier. It took me 5 minutes to build sqlite.dll with it.
Step by step with wxDev-c++ from
http://wxdsgn.sourceforge.net/?q=node/4 :
-Create New Project, Select DLL and check 'C Project', save the project in the dir containing sqlite3.c
-Remove the 2 auto created files from the project
-Add sqlite3.c (this will take a while to parse the huge file)
-Rebuild all
That's it, your dll will be in the Output\MingW subdir.
I have attached the Makefile.win created by the IDE.