Fixed perlmodule build for gcc-4.6

The problem is, what gcc-4.6 adds `--as-needed' to shared libraries.
And in this case library-order is important.