fiddle with the order of libraries.

seems to work this way with -fPIC static libraries.