It seems, there is something wrong with this line
Maybe your version of arduinoIDE doesn't support this code. Ask in Marlins github repo which IDE version to use.
...error: expected primary-expression before ')' token #define min(a,b) ((a)<(b)?(a): (b))
Maybe your version of arduinoIDE doesn't support this code. Ask in Marlins github repo which IDE version to use.