Don't link with dynamic library for static targets

avoids annoying linker warnings