Lavos may have awoken because he sensed the flame. But game wise, Schala unleashed the Mammon Machine that started draining the flame (the flame may also serve as a quasi dimensional link to Lavos and his power), which in turn drained it so fast and at such a degree that Lavos woke up.