Only add linker option if it is not really there

The `--as-needed` linker option was not added... eh... as needed, as this code is run unconditionally each time we do a reconfigure; if the option is added at each time, they will accumulate (needlessly) on the command-line, making it harder to inspect the log.