diff --git a/gtk/configure.ac b/gtk/configure.ac
index 92aabcbe8..1f4a1df95 100644
--- a/gtk/configure.ac
+++ b/gtk/configure.ac
@@ -199,7 +199,7 @@ PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
 
 GHB_CFLAGS="$HBINC $GHB_CFLAGS"
 
-HB_LIBS="-lhandbrake -lavformat -lavfilter -lavcodec -lavutil -ldav1d -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -llzma"
+HB_LIBS="-lhandbrake -lavformat -lavfilter -lavcodec -lavutil -ldav1d -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -llzma -ldl"
 
 if test "x$use_fdk_aac" = "xyes" ; then
     HB_LIBS="$HB_LIBS -lfdk-aac"
diff --git a/test/module.defs b/test/module.defs
index ffc00a8b2..62b01ffd5 100644
--- a/test/module.defs
+++ b/test/module.defs
@@ -69,6 +69,9 @@ else ifeq ($(HOST.system),linux)
 ifeq (1, $(FEATURE.numa))
     TEST.GCC.l += numa
 endif
+ifeq (1, $(FEATURE.x265))
+    TEST.GCC.l += x265
+endif
 else ifeq ($(HOST.system),kfreebsd)
     TEST.GCC.l += pthread dl m
 else ifeq ($(HOST.system),freebsd)
