Solved this on my own. If anybody else is having the same issue, try using Berkeley DB version 5.0.32. Worked for me.
Congrats! Which version of gcc did you use?
Originally 4.4, but then later 4.6.2... both work though with the newer DB version.
Why don't you use a newer one? 4.6.2 is very old.