The build command is correct.
Please print the return value of the nand_get_flash_type() function. Better yet, put some print statements before each return inside the nand_get_flash_type() function, so that we know what goes wrong with the NAND detection.
Best regards,
Miroslav