made linker flag -undefined dynamic_lookup conditional (only if apple)