fix issue for separate build dir

With my pull request earlier today ledger fails to build if build dir≠source dir.
Sorry this took a while. I waited for the build to succeed and my machine is kind of slow.
This should fix the build problems introduced in pull request #119.