Simplify conditional linking with libdl