improve detection of when to prefer libc++ linking