There are no pills you can take if you are already late for your period. Ibuprofen and midol are not safe for pregnancy because they can cause problems in the baby. Not because they will cause you to lose the baby.
Take a pregnancy test to find out if you are pregnant first. If not, get some birth control ASAP.