diff --git a/Bindings/OCaml/Makefile.in b/Bindings/OCaml/Makefile.in
index 47f7201..469f41e 100644
--- a/Bindings/OCaml/Makefile.in
+++ b/Bindings/OCaml/Makefile.in
@@ -55,13 +55,13 @@ OCAML_FILES = $(OCAML_MISC) $(OCAML_CLIBS) $(OCAML_BCLIB) $(OCAML_NCLIB)
 all : $(OCAML_FILES)
 
 $(OCAML_CLIBS) : brlapi_stubs.$O brlapi
-	$(OCAMLMKLIB) $(API_LDFLAGS) -oc $(OCAML_LIB)_stubs brlapi_stubs.$O
+	$(OCAMLMKLIB) -ldopt "$(LDFLAGS)" $(API_LDFLAGS) -oc $(OCAML_LIB)_stubs brlapi_stubs.$O
 
 $(OCAML_BCLIB) : $(OCAML_CLIBS) brlapi.cmo
 	$(OCAMLC) -a $(OCAMLMKLIB_FLAGS) -o $(OCAML_LIB).cma brlapi.cmo
 
 $(OCAML_NCLIB) : $(OCAML_CLIBS) brlapi.cmx
-	$(OCAMLMKLIB) $(OCAMLMKLIBOPT_FLAGS) -o $(OCAML_LIB) brlapi.cmx
+	$(OCAMLMKLIB) -ldopt "$(LDFLAGS)" $(OCAMLMKLIBOPT_FLAGS) -o $(OCAML_LIB) brlapi.cmx
 
 brlapi.cmi: brlapi.mli
 	$(OCAMLC) -o $@ -c brlapi.mli
diff --git a/configure.ac b/configure.ac
index daed454..8938c6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -544,9 +544,9 @@ in
 esac
 if test "${GCC}" = "yes"
 then
-   brltty_cv_prog_mklib="\$(CC) ${brltty_mklib_gcc_make=-shared} BRLTTY_OPTIONS_LD2CC([${brltty_mklib_ld_options+${brltty_mklib_ld_options} <name>}]) -o"
+   brltty_cv_prog_mklib="\$(CC) \$(LDFLAGS) ${brltty_mklib_gcc_make=-shared} BRLTTY_OPTIONS_LD2CC([${brltty_mklib_ld_options+${brltty_mklib_ld_options} <name>}]) -o"
 else
-   brltty_cv_prog_mklib="\$(LD) ${brltty_mklib_ld_make} ${brltty_mklib_ld_options+${brltty_mklib_ld_options} <name>} -o"
+   brltty_cv_prog_mklib="\$(LD) \$(LDFLAGS) ${brltty_mklib_ld_make} ${brltty_mklib_ld_options+${brltty_mklib_ld_options} <name>} -o"
 fi])
 AC_SUBST([MKLIB], ["${brltty_cv_prog_mklib}"])
 
