--- a/src/libgm2/libm2iso/Makefile.am
+++ b/src/libgm2/libm2iso/Makefile.am
@@ -215,7 +215,7 @@ if ENABLE_DARWIN_AT_RPATH
 libm2iso_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
 endif
 
-libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags)
+libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags) -lm
 CLEANFILES = SYSTEM.def
 BUILT_SOURCES = SYSTEM.def
 
--- a/src/libgm2/libm2iso/Makefile.in
+++ b/src/libgm2/libm2iso/Makefile.in
@@ -597,7 +597,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 @BUILD_ISOLIB_TRUE@@TARGET_DARWIN_FALSE@	$(am__append_1)
 @BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@libm2iso_la_link_flags = -Wl,-undefined,dynamic_lookup \
 @BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@	$(am__append_1)
-@BUILD_ISOLIB_TRUE@libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags)
+@BUILD_ISOLIB_TRUE@libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags) -lm
 @BUILD_ISOLIB_TRUE@CLEANFILES = SYSTEM.def
 @BUILD_ISOLIB_TRUE@BUILT_SOURCES = SYSTEM.def
 @BUILD_ISOLIB_TRUE@M2LIBDIR = /m2/m2iso/
--- a/src/libgm2/libm2log/Makefile.am
+++ b/src/libgm2/libm2log/Makefile.am
@@ -147,7 +147,7 @@ endif
 if ENABLE_DARWIN_AT_RPATH
 libm2log_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
 endif
-libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags)
+libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags) -lm
 BUILT_SOURCES = ../libm2pim/SYSTEM.def
 
 M2LIBDIR = /m2/m2log/
--- a/src/libgm2/libm2log/Makefile.in
+++ b/src/libgm2/libm2log/Makefile.in
@@ -492,7 +492,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 @BUILD_LOGLIB_TRUE@@TARGET_DARWIN_FALSE@	$(am__append_1)
 @BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@libm2log_la_link_flags = -Wl,-undefined,dynamic_lookup \
 @BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@	$(am__append_1)
-@BUILD_LOGLIB_TRUE@libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags)
+@BUILD_LOGLIB_TRUE@libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags) -lm
 @BUILD_LOGLIB_TRUE@BUILT_SOURCES = ../libm2pim/SYSTEM.def
 @BUILD_LOGLIB_TRUE@M2LIBDIR = /m2/m2log/
 all: $(BUILT_SOURCES)
--- a/src/libgm2/libm2pim/Makefile.am
+++ b/src/libgm2/libm2pim/Makefile.am
@@ -183,7 +183,7 @@ endif
 if ENABLE_DARWIN_AT_RPATH
 libm2pim_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
 endif
-libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags)
+libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) -lm
 BUILT_SOURCES = SYSTEM.def
 CLEANFILES = SYSTEM.def
 
--- a/src/libgm2/libm2pim/Makefile.in
+++ b/src/libgm2/libm2pim/Makefile.in
@@ -556,7 +556,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 @BUILD_PIMLIB_TRUE@@TARGET_DARWIN_FALSE@	$(am__append_1)
 @BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup \
 @BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@	$(am__append_1)
-@BUILD_PIMLIB_TRUE@libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags)
+@BUILD_PIMLIB_TRUE@libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) -lm
 @BUILD_PIMLIB_TRUE@BUILT_SOURCES = SYSTEM.def
 @BUILD_PIMLIB_TRUE@CLEANFILES = SYSTEM.def
 @BUILD_PIMLIB_TRUE@M2LIBDIR = /m2/m2pim/
