diff --git a/configure.in b/configure.in
index e9ed537c00..c7c299bebb 100644
--- a/configure.in
+++ b/configure.in
@@ -787,6 +787,7 @@ CHECK_ERLANG
 AC_CONFIG_FILES([Makefile
                 src/Makefile
                 src/mod/Makefile
+                src/mod/applications/mod_enum/Makefile
                 src/mod/endpoints/mod_sofia/Makefile
                 src/mod/asr_tts/mod_unimrcp/Makefile
                 src/mod/languages/mod_java/Makefile
diff --git a/libs/udns/udns_resolver.c b/libs/udns/udns_resolver.c
index 87a4d91951..acb3ca4dd7 100644
--- a/libs/udns/udns_resolver.c
+++ b/libs/udns/udns_resolver.c
@@ -45,6 +45,9 @@ int udns_inet_pton(int, const char *, void *);
 # undef HAVE_POLL
 #else
 #define udns_inet_pton inet_pton
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
 # include <sys/types.h>
 # include <sys/socket.h>
 # include <netinet/in.h>
diff --git a/src/mod/applications/mod_enum/Makefile b/src/mod/applications/mod_enum/Makefile
deleted file mode 100644
index db458aea74..0000000000
--- a/src/mod/applications/mod_enum/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-BASE=../../../..
-UDNS_DIR=$(MODDIR)/../../../../libs/udns
-LOCAL_CFLAGS=-I$(UDNS_DIR) -DHAVE_POLL
-LOCAL_OBJS=$(UDNS_DIR)/udns_dn.o $(UDNS_DIR)/udns_dntosp.o $(UDNS_DIR)/udns_parse.o $(UDNS_DIR)/udns_misc.o \
-$(UDNS_DIR)/udns_rr_a.o $(UDNS_DIR)/udns_rr_ptr.o $(UDNS_DIR)/udns_rr_mx.o $(UDNS_DIR)/udns_rr_txt.o $(UDNS_DIR)/udns_bl.o \
-$(UDNS_DIR)/udns_rr_srv.o $(UDNS_DIR)/udns_rr_naptr.o $(UDNS_DIR)/udns_codes.o $(UDNS_DIR)/udns_resolver.o
-
-
-include $(BASE)/build/modmake.rules
-
diff --git a/src/mod/applications/mod_enum/Makefile.am b/src/mod/applications/mod_enum/Makefile.am
new file mode 100644
index 0000000000..beea7e2416
--- /dev/null
+++ b/src/mod/applications/mod_enum/Makefile.am
@@ -0,0 +1,14 @@
+include $(top_srcdir)/build/modmake.rulesam
+MODNAME=mod_enum
+
+UDNS_DIR=$(switch_srcdir)/libs/udns
+AM_CFLAGS += -I$(UDNS_DIR) -DHAVE_POLL
+
+mod_LTLIBRARIES = mod_enum.la
+mod_enum_la_SOURCES  = mod_enum.c 
+mod_enum_la_SOURCES += $(UDNS_DIR)/udns_dn.c $(UDNS_DIR)/udns_dntosp.c $(UDNS_DIR)/udns_parse.c $(UDNS_DIR)/udns_misc.c
+mod_enum_la_SOURCES += $(UDNS_DIR)/udns_rr_a.c $(UDNS_DIR)/udns_rr_ptr.c $(UDNS_DIR)/udns_rr_mx.c $(UDNS_DIR)/udns_rr_txt.c $(UDNS_DIR)/udns_bl.c
+mod_enum_la_SOURCES += $(UDNS_DIR)/udns_rr_srv.c $(UDNS_DIR)/udns_rr_naptr.c $(UDNS_DIR)/udns_codes.c $(UDNS_DIR)/udns_resolver.c
+mod_enum_la_CFLAGS   = $(AM_CFLAGS)
+mod_enum_la_LIBADD   = $(switch_builddir)/libfreeswitch.la
+mod_enum_la_LDFLAGS  = -avoid-version -module -no-undefined