Why some carbons may or may not graphitize? The point of view of thermodynamics