For what it's worth, I found out today using Ubuntu 12.04 that I needed to add /lib/x86_64-linux-gnu to my LDFLAGS as well in order to pick up zlib, bz2, and friends. In fact, I found it much easier...