64 bit compatibility and light rework of build scripts