Fixed building outside the source directory

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