freebsd doesn't need -ldl for compilation