Amorphous-crystalline transition in thermoelectric NbO2