Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,9 @@
 
 # OS specific instructions
 -include sysdeps/$(shell uname).inc
+ifeq ($(shell uname),GNU/kFreeBSD)
+	-include sysdeps/FreeBSD.inc
+endif
 
 ifeq ($(LUA), 1)
 	LUALIBS=$(LUA_LIBS_CONFIG)
Index: b/kqueuemplexer.cc
===================================================================
--- a/kqueuemplexer.cc
+++ b/kqueuemplexer.cc
@@ -6,7 +6,7 @@
 #include <boost/lexical_cast.hpp>
 #include "syncres.hh"
 #include <sys/types.h>
-#ifdef __FreeBSD__ 
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/event.h>
 #endif
 #include <sys/time.h>
