Make as needed optional

Since my build now failed with GCC 4.8.2 in debug mode with these pesky linker errors as well, I could not build anything anymore given the fact that CLang currently can't compile dune-cornerpoint. I thus decided to make the `-Wl,--as-needed` flag optional.

This PR supersedes #565...