configure: check for --as-needed support early