I suggest you to check that the SPI data is being sent properly. I checked and ran the code and I got the same message as you: "Something wrong with thermocouple!". The function isnan() makes sure that the value returned by thermocouple.readCelsius() is actually a number ("isnan" means "is not a number"). I don't have the MAX31855 breakout board so I guess that I'm getting that output message because my Edison is not getting any data through the SPI, but since you have the MAX31855 breakout board I recommend you to check that the SPI data sent/received by the Edison is correct.
One more observation, in the code you posted you have a duplicate section from line 50 to line 61.