diff --git a/transport-native-epoll/pom.xml b/transport-native-epoll/pom.xml
index 09c4d3b8970..d9b46e6c707 100644
--- a/transport-native-epoll/pom.xml
+++ b/transport-native-epoll/pom.xml
@@ -155,6 +155,7 @@
${jni.compiler.args.ldflags}
${jni.compiler.args.cflags}
+ --libdir=${project.build.directory}/native-build/target/lib
diff --git a/transport-native-kqueue/pom.xml b/transport-native-kqueue/pom.xml
index 1bddd4f492a..1a0d49434d0 100644
--- a/transport-native-kqueue/pom.xml
+++ b/transport-native-kqueue/pom.xml
@@ -84,6 +84,7 @@
explicitly set the target platform. Otherwise we may get fatal link errors due to weakly linked
methods which are not expected to be present on MacOS (e.g. accept4). -->
MACOSX_DEPLOYMENT_TARGET=10.6
+ --libdir=${project.build.directory}/native-build/target/lib