When Nim compile your code, Nim generates C files and call the backend C compiler. In your case, the backend C compiler is GCC. GCC compiles the generated C file and generates a object file. Generated object files and libraries are linked by `ld.exe` and it generates an executable file. `-lz` option adds a library to the linker. <https://sourceware.org/binutils/docs-2.41/ld/Options.html> <https://sourceware.org/binutils/docs-2.41/ld/WIN32.html>
It seems one of imported libraries in your project try to link `libz` but you don't have that library.