Fix building on GCC 4.6

This commit fixes building on GCC 4.6 where the linker ignores libraries it find not needed (ie. not used by any object scanned so far). This behaviour can be changed by adding "-Wl,--no-as-needed" to the gcc arguments.