diff -ur sparsersb-1.0.0.orig/src/autogen.sh sparsersb-1.0.0/src/autogen.sh
--- sparsersb-1.0.0.orig/src/autogen.sh	2015-11-10 06:07:55.812398937 -0500
+++ sparsersb-1.0.0/src/autogen.sh	2015-11-22 18:40:12.413271177 -0500
@@ -16,6 +16,9 @@
 if test x"\$LIBRSB_LIBS" = x ; then
 	LIBRSB_LIBS="\`\$LIBRSB_CONFIG --ldflags | sed 's/ -static/ /g'\` -lgomp"
 fi
+if test x"\$SPARSERSB_LIBS" = x ; then
+	SPARSERSB_LIBS="\`\$LIBRSB_CONFIG --extra_libs\`"
+fi
 AC_OPENMP([])
 ##
 STATUS_MSG="
diff -ur sparsersb-1.0.0.orig/src/configure.base sparsersb-1.0.0/src/configure.base
--- sparsersb-1.0.0.orig/src/configure.base	2015-11-10 06:07:55.808398969 -0500
+++ sparsersb-1.0.0/src/configure.base	2015-11-22 18:40:51.666950216 -0500
@@ -54,6 +54,8 @@
 dnl Check for mkoctfile
 AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile)
 test -z "$MKOCTFILE" &&	AC_MSG_WARN([no mkoctfile found on path])
+AC_CHECK_PROG(OCTAVE_CONFIG,octave-config,octave-config)
+test -z "$OCTAVE_CONFIG" && AC_MSG_WARN([no octave-config found on path])
 
 AC_SUBST(ver)
 AC_SUBST(subver)
@@ -193,21 +195,24 @@
 # add -fPIC or equivalent flags
 FPICFLAG=`$MKOCTFILE -p FPICFLAG`
 CPICFLAG=`$MKOCTFILE -p CPICFLAG`
+
 FFLAGS="$FFLAGS $FPICFLAG"
 CFLAGS="$CFLAGS $CPICFLAG"
 AC_SUBST(CC)
 AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(CPICFLAG)
+
 RSBOI_CXXFLAGS=""
 if test x$RSBOI_VERBOSE_CONFIG != x ; then
-	RSBOI_CXXFLAGS="$RSBOI_CXXFLAGS -D''RSBOI_VERBOSE_CONFIG=$RSBOI_VERBOSE_CONFIG"; 
+	RSBOI_CXXFLAGS="$RSBOI_CXXFLAGS -DRSBOI_VERBOSE_CONFIG=$RSBOI_VERBOSE_CONFIG"; 
 fi
 
 dnl Fortran compiler and flags
 F77=`$MKOCTFILE -p F77`
 FFLAGS=`$MKOCTFILE -p FFLAGS`
 FPICFLAG=`$MKOCTFILE -p FPICFLAG`
+
 AC_SUBST(F77)
 AC_SUBST(FFLAGS)
 AC_SUBST(FPICFLAG)
@@ -304,6 +309,24 @@
 AC_SUBST($2)
 ])
 
+dnl Use octave-config to get an octave setting
+dnl and set as an variable
+dnl
+AC_DEFUN(OCTAVE_CONFIG_EVAL,
+[AC_MSG_CHECKING([for $1 in octave-config])
+$2=`$OCTAVE_CONFIG -p $1`
+AC_MSG_RESULT($$2)
+AC_SUBST($2)
+])
+
+AC_DEFUN(MKOCTFILE_EVAL,
+[AC_MSG_CHECKING([for $1 in mkoctfile])
+$2=`$MKOCTFILE -p $1`
+AC_MSG_RESULT($$2)
+AC_SUBST($2)
+])
+
+
 dnl Check status of an octave variable
 dnl
 dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false)
@@ -321,13 +344,16 @@
 
 dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version
 AC_CHECK_PROG(OCTAVE,octave,octave)
-OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION)
+dnl OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION)
+OCTAVE_CONFIG_EVAL(VERSION,OCTAVE_VERSION)
 
 dnl grab canonical host type so we can write system specific install stuff
-OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type)
+dnl OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type)
+OCTAVE_CONFIG_EVAL(CANONICAL_HOST_TYPE,canonical_host_type)
 
 dnl grab SHLEXT from octave config
-OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT)
+dnl OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT)
+OCTAVE_CONFIG_EVAL(SHLEXT,SHLEXT)
 
 AC_PROG_LN_S
 
@@ -346,8 +372,10 @@
 OF_CHECK_LIB(m,sin,[OTHERLIBS=-lm])
 AC_SUBST(OTHERLIBS)
 
-OCTAVE_EVAL(octave_config_info('AR'),AR)
-OCTAVE_EVAL(octave_config_info('ARFLAGS'),ARFLAGS)
+dnl OCTAVE_EVAL(octave_config_info('AR'),AR)
+dnl OCTAVE_EVAL(octave_config_info('ARFLAGS'),ARFLAGS)
+MKOCTFILE_EVAL(AR,AR)
+MKOCTFILE_EVAL(ARFLAGS,ARFLAGS)
 
 CPPFLAGS="$CPPFLAGS -DSTATIC_LINKED"
 
@@ -402,4 +430,6 @@
    CXXFLAGS:    $CXXFLAGS
    octave:      $OCTAVE (version $OCTAVE_VERSION)
    mkoctfile:	$MKOCTFILE for Octave $subver
+   octave-config: $OCTAVE_CONFIG for Octave $subver
    swig:        $SWIG"
+
diff -ur sparsersb-1.0.0.orig/src/Makeconf.in sparsersb-1.0.0/src/Makeconf.in
--- sparsersb-1.0.0.orig/src/Makeconf.in	2015-11-10 06:07:55.808398969 -0500
+++ sparsersb-1.0.0/src/Makeconf.in	2015-11-10 06:19:13.844014051 -0500
@@ -61,6 +61,7 @@
 OCTAVE = @OCTAVE@
 OCTAVE_VERSION = @OCTAVE_VERSION@
 MKOCTFILE = @MKOCTFILE@ -DHAVE_OCTAVE_$(ver) -v
+OCTAVE_CONFIG = @OCTAVE_CONFIG@
 SHLEXT = @SHLEXT@
 
 ver = @ver@
diff -ur sparsersb-1.0.0.orig/src/Makefile sparsersb-1.0.0/src/Makefile
--- sparsersb-1.0.0.orig/src/Makefile	2015-11-10 06:07:55.811398945 -0500
+++ sparsersb-1.0.0/src/Makefile	2015-11-22 18:59:21.037943930 -0500
@@ -23,7 +23,7 @@
 #LIBRSB_LIBS=$(RSBLIBDIR)/librsb.a
 
 $(SPARSERSB_OCT): sparsersb.cc
-	CXXFLAGS="$(CXXFLAGS)" $(MKOCTFILE)  -D''RSB_SPARSERSB_LABEL=sparsersb $(RSBOI_CXXFLAGS) $(LIBRSB_CXXFLAGS) -o $@ $< $(LIBRSB_LIBS) $(SPARSERSB_LIBS)
+	CXXFLAGS="$(CXXFLAGS)" $(MKOCTFILE)  -D'RSB_SPARSERSB_LABEL=sparsersb' $(RSBOI_CXXFLAGS) $(LIBRSB_CXXFLAGS) -o $@ $< $(LIBRSB_LIBS) $(SPARSERSB_LIBS)
 
 rtest: $(SPARSERSB_OCT)
 	$(OCTAVE) --silent ../inst/sparsersbtester.m
