Do not wait - act immediately. And yes, first place to start can be (unexpectedly) the Prefecture.
Official advice is: If you have already overstayed your visa you need to deal with the situation as soon as possible. Usually the best approach is to leave immediately, then try to regularise from outside.
If there is an insurmountable reason that you cannot leave, such as being in hospital, you should contact your local prefecture as a matter of urgency. Visas are issued by consular authorities, but the prefecture can, in exceptional circumstances, issue a visa extension. Proof/valid supporting documents will be required. This authorisation is called an autorisation provisoire de séjour and it cannot exceed 180 days. It is issued by a departmental prefecture in exceptional and unforeseen situations, for example if you are too ill to travel and need to stay to receive treatment.
While you wait to hear if your extension has been successful, you will officially be in a waiting period. This is useful because people awaiting a decision can prove they are still living in France legally if challenged.
The same conditions apply if you are visiting under the 90 day rule where no visa is required.
If you decide to leave, MAKE SURE you tell the border control officer the story and show proof BEFORE you exit. Otherwise the system may flag you and prevent you entering next time.
Kind regards
Ian