Get the build output path from cabal
Merged pull request by @liesen, fixing the hardcoded use of dist as builddir.