put -ldl last, mac linker fix