Index: src/configure
--- src/configure.orig	2017-09-02 17:18:40.000000000 +0200
+++ src/configure	2017-09-02 17:39:55.850344000 +0200
@@ -455,20 +455,20 @@
 
 function linux_configure_speex {
   # Check whether the user has called tools/extras/install_speex.sh or not
-  [ ! -z "$SPEEXROOT" ] || SPEEXROOT=`pwd`/../tools/speex
+  [ ! -z "$SPEEXROOT" ] || SPEEXROOT=$FSTROOT
   [ ! -z "$SPEEXLIBDIR" ] || SPEEXLIBDIR="$SPEEXROOT"/lib
   [ ! -z "$SPEEXINCDIR" ] || SPEEXINCDIR="$SPEEXROOT"/include
-  static_speex=$1
-  if [ "foo"$static_speex == "foo" ]; then
+  static_speex=yes
+  if [ "foo$static_speex" == "foo" ]; then
     static_speex=false
   fi
 
-  if $static_speex; then
+  if [ "$static_speex" == "yes" ]; then
     spx_type=a
   else
     spx_type=so
   fi
-  if [ ! -f "$SPEEXLIBDIR/libspeex.${spx_type}" ];then
+  if [ ! -f "$SPEEXLIBDIR/libspeexdsp.${spx_type}" ];then
     echo "Info: configuring Kaldi not to link with Speex (don't worry, it's only needed if you"
     echo "intend to use 'compress-uncompress-speex', which is very unlikely)"
     return
@@ -479,9 +479,9 @@
     echo CXXFLAGS += -DHAVE_SPEEX -I${SPEEXINCDIR} >> kaldi.mk
 
     if $static_speex; then
-      echo LDLIBS += $SPEEXLIBDIR/libspeex.a
+      echo LDLIBS += $SPEEXLIBDIR/libspeexdsp.a
     else
-      echo LDLIBS += -L${SPEEXLIBDIR} -lspeex >> kaldi.mk
+      echo LDLIBS += -L${SPEEXLIBDIR} -lspeexdsp >> kaldi.mk
       echo LDFLAGS += -Wl,-rpath=${SPEEXLIBDIR} >> kaldi.mk
     fi
 
@@ -1074,7 +1074,7 @@
   failure "Could not find file $FSTROOT/include/fst/fst.h:
   you may not have installed OpenFst. See ../tools/INSTALL"
 fi
-OPENFST_VER=${OPENFST_VER:-$(grep 'PACKAGE_VERSION' $FSTROOT/Makefile | sed -e 's:.*= ::')}
+OPENFST_VER=1.6.3
 OPENFST_VER_NUM=$(echo $OPENFST_VER | sed 's/\./ /g' | xargs printf "%d%02d%02d")
 if [ $OPENFST_VER_NUM -lt 10600 ]; then
   failure "OpenFst-$OPENFST_VER is not supported. You need OpenFst >= 1.6.0.)"
@@ -1086,7 +1086,7 @@
   if [ "`uname`" == "Darwin"  ]; then
     OPENFSTLIBS="$FSTROOT/lib/libfst.dylib"
     OPENFSTLDFLAGS="-Wl,-rpath -Wl,${FSTROOT}/lib"
-  elif [ "`uname`" == "Linux" ]; then
+  elif [ "`uname`" == "Linux" ] || [ "`uname`" == "FreeBSD" ]; then
     OPENFSTLIBS="$FSTROOT/lib/libfst.so"
     OPENFSTLDFLAGS="-Wl,-rpath=${FSTROOT}/lib"
   else
@@ -1173,7 +1173,7 @@
   cat makefiles/cygwin.mk >> kaldi.mk
   echo "Successfully configured for Cygwin with CLAPACK."
 
-elif [ "`uname`" == "Linux" ]; then
+elif [ "`uname`" == "Linux" ] || [ "`uname`" == "FreeBSD" ]; then
   echo "On Linux: Checking for linear algebra header files ..."
   if [ "$MATHLIB" == "ATLAS" ]; then
     if [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ; then
@@ -1300,7 +1300,7 @@
     if [ -z "$OPENBLASROOT" ]; then
       failure "Must specify the location of OPENBLAS with --openblas-root option (and it must exist)"
     fi
-    if [ ! -f $OPENBLASROOT/lib/libopenblas.so ]; then
+    if [ ! -f $OPENBLASROOT/lib/libopenblas.a ]; then
       failure "Expected to find the file $OPENBLASROOT/lib/libopenblas.so"
     fi
     echo "Your math library seems to be OpenBLAS from $OPENBLASROOT.  Configuring appropriately."
Index: src/makefiles/linux_openblas.mk
--- src/makefiles/linux_openblas.mk.orig	2017-09-02 17:18:40.000000000 +0200
+++ src/makefiles/linux_openblas.mk	2017-09-02 17:37:43.002963000 +0200
@@ -21,8 +21,7 @@
            -Wno-deprecated-declarations -Winit-self \
            -DKALDI_DOUBLEPRECISION=$(DOUBLE_PRECISION) \
            -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_OPENBLAS -I$(OPENBLASINC) \
-           -msse -msse2 -pthread \
-           -g # -O0 -DKALDI_PARANOID
+           -msse -msse2 -pthread
 
 ifeq ($(KALDI_FLAVOR), dynamic)
 CXXFLAGS += -fPIC
Index: src/makefiles/default_rules.mk
--- src/makefiles/default_rules.mk.orig	2017-09-02 17:40:17.991987000 +0200
+++ src/makefiles/default_rules.mk	2017-09-02 17:41:35.971707000 +0200
@@ -1,5 +1,5 @@
 
-SHELL := /bin/bash
+SHELL := bash
 
 ifeq ($(KALDI_FLAVOR), dynamic)
   ifeq ($(shell uname), Darwin)
