Raspberry Pi uses 64-bit kernel with 32-bit system (see <https://github.com/raspberrypi/firmware/issues/1795>). That probably what confuses build script. You can switch to 32-bit kernel by adding "arm_64bit=0" line to "/boot/config.txt".
You can also try to pass your OS architecture to the script with an argument, e.g: sh build.sh --cpu armv71 Run