fix dynamic linking of libraries