What about this?
../../../tools/winegcc/winegcc -B../../../tools/winebuild -mconsole encode.o protectdata.o testlist.o -o crypt32_test.exe.so -L../../../libs/port -lwine_port -L../../../dlls -L../../../dlls/crypt32 -L../../../libs -lcrypt32 encode.o(.text+0x38): In function `func_encode': /home/phantom/src/wine/dlls/crypt32/tests/encode.c:56: undefined reference to `CryptEncodeObjectEx' encode.o(.text +0x83):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:63: undefined reference to `CryptEncodeObjectEx' encode.o(.text +0x12a):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:71: undefined reference to `CryptEncodeObjectEx' encode.o(.text +0x175):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:75: undefined reference to `CryptEncodeObjectEx' encode.o(.text +0x246):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:101: undefined reference to `CryptDecodeObjectEx' encode.o(.text +0x285):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:108: undefined reference to `CryptDecodeObjectEx' encode.o(.text +0x2c7):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:112: undefined reference to `CryptDecodeObjectEx' encode.o(.text +0x317):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:118: undefined reference to `CryptDecodeObjectEx' encode.o(.text +0x3a3):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:126: undefined reference to `CryptDecodeObjectEx' encode.o(.text +0x3f8):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:131: more undefined references to `CryptDecodeObjectEx' follow encode.o(.text+0x593): In function `func_encode': /home/phantom/src/wine/dlls/crypt32/tests/encode.c:173: undefined reference to `CryptUnregisterOIDFunction' encode.o(.text +0x5fb):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:179: undefined reference to `CryptUnregisterOIDFunction' encode.o(.text +0x6b7):/home/phantom/src/wine/dlls/crypt32/tests/encode.c:196: undefined reference to `CryptUnregisterOIDFunction' protectdata.o(.text+0x390): In function `func_protectdata': /home/phantom/src/wine/dlls/crypt32/tests/protectdata.c:114: undefined reference to `CryptUnprotectData' protectdata.o(.text +0x3f4):/home/phantom/src/wine/dlls/crypt32/tests/protectdata.c:120: undefined reference to `CryptUnprotectData' protectdata.o(.text +0x467):/home/phantom/src/wine/dlls/crypt32/tests/protectdata.c:129: undefined reference to `CryptUnprotectData' protectdata.o(.text +0x4ec):/home/phantom/src/wine/dlls/crypt32/tests/protectdata.c:140: undefined reference to `CryptUnprotectData' protectdata.o(.text +0x669):/home/phantom/src/wine/dlls/crypt32/tests/protectdata.c:160: undefined reference to `CryptUnprotectData' protectdata.o(.text +0x6d6):/home/phantom/src/wine/dlls/crypt32/tests/protectdata.c:167: more undefined references to `CryptUnprotectData' follow collect2: ld returned 1 exit status winegcc: gcc failed. make[3]: *** [crypt32_test.exe.so] Error 2 make[3]: Leaving directory `/home/phantom/src/wine/dlls/crypt32/tests' make[2]: *** [tests] Error 2 make[2]: Leaving directory `/home/phantom/src/wine/dlls/crypt32' make[1]: *** [crypt32] Error 2 make[1]: Leaving directory `/home/phantom/src/wine/dlls' make: *** [dlls] Error 2