Various build & linking fixes.

Signed-off-by: Peter Soetens <peter@thesourceworks.com>
Version 2.6.0.10

Signed-off-by: Peter Soetens <peter@thesourceworks.com>