Make the flag testing logic for linker flags work like the compiler flag testing.

Change-Id: I2478417cbcd395247215f149978c5f0c874c9b3a
Reviewed-on: https://code.wireshark.org/review/2779
Reviewed-by: Jörg Mayer <jmayer@loplof.de>