Allow building outside source tree

Change-Id: I7598cdf3b898b79ee7838b97642c91873cdf4a95
Reviewed-on: http://review.couchbase.org/33942
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>