Fixes to be able to build outside of the build system

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>