--- a/src/lib/mkMake
+++ b/src/lib/mkMake
@@ -143,7 +143,7 @@
 # no effort whatsoever to maintain any kind of ABI compat in this lib. Only
 # programs or modules from the same Recoll release can be compatible.
 \$(LIBRECOLL): \$(DEPS) \$(OBJS)
-	g++ -shared -Wl,--no-undefined -Wl,--warn-unresolved-symbols \
+	\$(CXX) -shared -Wl,--no-undefined -Wl,--warn-unresolved-symbols \
           -Wl,-soname=\$(LIBRECOLL) -o \$(LIBRECOLL) \$(OBJS) \
            \$(LIBXAPIAN) \$(LIBICONV) \$(X_LIBX11) \$(LIBSYS)
 	rm -f librecoll.so