mac compatible libc lookup in tests

see comments in 0ed0558a