fixed rebuild to work on x86/x64 systems