Visit your immigration authorities and ask gently what you can do. My experience with Thai immigration was that they are helpful, supportive to solve your issue, and of course its your and nobody else fault to book everything for leaving on the last minute. Keep gently in mind and the immigration may grant you a couple of additional days to leave for a fee comparable to a fine. However, having a fine issued, you'll never know how visa rules will be applied in a couple of years.