diff --git a/Makefile.in b/Makefile.in
index 19453cc..6edaf21 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -16,7 +16,7 @@
 # with thin-provisioning-tools.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-V=@
+V=
 
 PROGRAMS=\
 	bin/pdata_tools
@@ -141,7 +141,6 @@ endif
 
 CC:=@CC@
 CXX:=@CXX@
-STRIP:=@STRIP@
 OBJECTS:=$(subst .cc,.o,$(SOURCE))
 
 ifeq ("@STATIC@", "yes")
@@ -150,18 +149,22 @@ endif
 
 TOP_DIR:=@top_srcdir@
 TOP_BUILDDIR:=@top_builddir@
-CFLAGS+=-g -Wall -O3 -fPIC
+CFLAGS+=-g -Wall -fPIC
+CFLAGS+=@CFLAGS@
+CFLAGS+=@CPPFLAGS@
 CFLAGS+=@LFS_FLAGS@
-CXXFLAGS+=-g -Wall -fPIC -fno-strict-aliasing -std=c++11
+CXXFLAGS+=-g -Wall -fPIC -fno-strict-aliasing
+CXXFLAGS+=@CXXFLAGS@
+CXXFLAGS+=@CPPFLAGS@
 
 ifeq ("@DEVTOOLS@", "yes")
 CXXFLAGS+=-DDEV_TOOLS
 endif
 
-CXXFLAGS+=@CXXOPTIMISE_FLAG@
 CXXFLAGS+=@CXXDEBUG_FLAG@
 CXXFLAGS+=@CXX_STRERROR_FLAG@
 CXXFLAGS+=@LFS_FLAGS@
+LDFLAGS=@LDFLAGS@
 INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
 LIBS:=-laio -lexpat -ldl
 
@@ -169,21 +172,15 @@ ifeq ("@DEVTOOLS@", "yes")
 LIBS+=-lncurses
 endif
 
-ifeq ("@STATIC_CXX@", "yes")
-CXXLIB+=-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -Wl,--as-needed
-else
-CXXLIB+=-lstdc++
-endif
-
 ifeq ("@STATIC@", "yes")
 LDFLAGS+=-static
 endif
 
 INSTALL:=@INSTALL@
-PREFIX:=@prefix@
-BINDIR:=$(DESTDIR)$(PREFIX)/sbin
-DATADIR:=$(DESTDIR)$(PREFIX)/share
-MANPATH:=$(DATADIR)/man
+prefix:=@prefix@
+exec_prefix:=@exec_prefix@
+BINDIR:=$(DESTDIR)@sbindir@
+MANPATH:=$(DESTDIR)@mandir@
 
 vpath %.cc $(TOP_DIR)
 
@@ -282,7 +279,6 @@ MANPAGES:=$(patsubst %,man8/%.8,$(TOOLS))
 install: bin/pdata_tools $(MANPAGES)
 	$(INSTALL_DIR) $(BINDIR)
 	$(INSTALL_PROGRAM) bin/pdata_tools $(BINDIR)
-	$(STRIP) $(BINDIR)/pdata_tools
 	ln -s -f pdata_tools $(BINDIR)/cache_check
 	ln -s -f pdata_tools $(BINDIR)/cache_dump
 	ln -s -f pdata_tools $(BINDIR)/cache_metadata_size
@@ -345,8 +341,7 @@ LIBFT_SOURCE=\
 LIBFT_OBJECTS=$(subst .c,.o,$(LIBFT_SOURCE))
 
 lib/libft.so: $(LIBFT_OBJECTS)
-	@echo "    [LD]" $@
-	$(V) gcc -shared -o $@ $+ -laio
+	$(V) $(CC) $(CFLAGS) -shared -o $@ $+ -laio
 
 .PHONEY: functional-test unit-test
 
diff --git a/ft-lib/bcache.c b/ft-lib/bcache.c
index 0dca503..ee5b6c5 100644
--- a/ft-lib/bcache.c
+++ b/ft-lib/bcache.c
@@ -31,7 +31,7 @@ static void warn(const char *fmt, ...)
 }
 
 // FIXME: raise a condition somehow?
-static void raise(const char *fmt, ...)
+static void raise_(const char *fmt, ...)
 {
 	va_list ap;
 
@@ -51,7 +51,7 @@ static inline struct list_head *list_pop(struct list_head *head)
 	struct list_head *l;
 
 	if (head->next == head)
-		raise("list is empty\n");
+		raise_("list is empty\n");
 
 	l = head->next;
 	list_del(l);
@@ -98,7 +98,7 @@ static struct cb_set *cb_set_create(unsigned nr)
 static void cb_set_destroy(struct cb_set *cbs)
 {
 	if (!list_empty(&cbs->allocated))
-		raise("async io still in flight");
+		raise_("async io still in flight");
 
 	free(cbs->vec);
 	free(cbs);
@@ -713,13 +713,13 @@ struct bcache *bcache_simple(const char *path, unsigned nr_cache_blocks)
 	uint64_t s;
 
 	if (fd < 0) {
-		raise("couldn't open cache file");
+		raise_("couldn't open cache file");
 		return NULL;
 	}
 
 	r = fstat(fd, &info);
 	if (r < 0) {
-		raise("couldn't stat cache file");
+		raise_("couldn't stat cache file");
 		return NULL;
 	}
 
@@ -751,7 +751,7 @@ void bcache_destroy(struct bcache *cache)
 static void check_index(struct bcache *cache, block_address index)
 {
 	if (index >= cache->nr_data_blocks)
-		raise("block out of bounds (%llu >= %llu)",
+		raise_("block out of bounds (%llu >= %llu)",
 		      (unsigned long long) index,
 		      (unsigned long long) cache->nr_data_blocks);
 }
@@ -802,7 +802,7 @@ static struct block *lookup_or_read_block(struct bcache *cache,
 		// FIXME: this is insufficient.  We need to also catch a read
 		// lock of a write locked block.  Ref count needs to distinguish.
 		if (b->ref_count && (flags & (GF_DIRTY | GF_ZERO)))
-			raise("concurrent write lock attempt");
+			raise_("concurrent write lock attempt");
 
 		if (test_flags(b, BF_IO_PENDING)) {
 			miss(cache, flags);
@@ -858,7 +858,7 @@ struct block *get_block(struct bcache *cache, block_address index, unsigned flag
 		return b;
 	}
 
-	raise("couldn't get block");
+	raise_("couldn't get block");
 	return NULL;
 }
 
diff --git a/unit-tests/io_engine_t.cc b/unit-tests/io_engine_t.cc
index d9a25e3..d46b98b 100644
--- a/unit-tests/io_engine_t.cc
+++ b/unit-tests/io_engine_t.cc
@@ -37,11 +37,12 @@ using namespace testing;
 
 namespace {
 	unsigned const MAX_IO = 64;
+	unsigned const BLOCK_SIZE = std::max(64l * 512, PAGE_SIZE);
 
 	class IOEngineTests : public Test {
 	public:
 		IOEngineTests()
-			: pool_(64 * 512, 128 * 512, PAGE_SIZE),
+			: pool_(BLOCK_SIZE, 2 * BLOCK_SIZE, PAGE_SIZE),
 			  src_file_("copy_src", 32),
 			  dest_file_("copy_dest", 32),
 			  engine_(new aio_engine(MAX_IO)) {
