For linking against an .so-file you may pass it as object with option -o as you link other object files, probably with full path, as path option -L does not apply for object files.
The runtime will treat the shared library like a dll, trying to load it on startup.