Fix out of the source build

This allows use of a separate directory for source and object
files

Change-Id: I81186f503131f5ef72627146c1e9f6c0f1f5840a
Reviewed-on: http://review.couchbase.org/33933
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>