diff -urN bladeenc-0.94.2/bladeenc/Makefile.am bladeenc-0.94.2-haiku/bladeenc/Makefile.am
--- bladeenc-0.94.2/bladeenc/Makefile.am	2001-02-21 13:59:25.000000000 +0000
+++ bladeenc-0.94.2-haiku/bladeenc/Makefile.am	2009-07-19 04:44:49.000000000 +0000
@@ -2,5 +2,5 @@
 
 bladeenc_SOURCES = tables.c strupr.c samplein.c reservoir.c mdct.c main.c loop.c l3psy.c l3bitstream.c formatbitstream2.c encode.c common.c codec.c bladesys.c arglink.c subs.c arglink.h bladesys.h codec.h common.h encoder.h formatbitstream2.h huffman.h l3bitstream-pvt.h l3bitstream.h l3psy.h l3side.h loop-pvt.h loop.h mdct.h reservoir.h samplein.h system.h tables.h
 
-bladeenc_LDADD   =  -lm
+bladeenc_LDADD   =
 
diff -urN bladeenc-0.94.2/bladeenc/system.h bladeenc-0.94.2-haiku/bladeenc/system.h
--- bladeenc-0.94.2/bladeenc/system.h	2001-05-08 12:11:53.000000000 +0000
+++ bladeenc-0.94.2-haiku/bladeenc/system.h	2009-07-19 04:38:45.000000000 +0000
@@ -74,7 +74,7 @@
 #		define		SYSTEM		WIN32_INTEL		
 #	endif
 
-#	ifdef  __BEOS__
+#	if defined __BEOS__ || defined __HAIKU__
 #		define		SYSTEM		BEOS
 #	endif

diff -aurN bladeenc-0.94.2/configure.in bladeenc-0.94.2-haiku/configure.in
--- bladeenc-0.94.2/configure.in	2001-05-03 10:32:44.040894464 +0000
+++ bladeenc-0.94.2-haiku/configure.in	2013-11-30 16:49:17.864026624 +0000
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(Makefile.am)

-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)

 AM_INIT_AUTOMAKE(bladeenc,0.94.2)
 
