Fixed a linker problem with GCC 4.8 caused by as-needed flag