Doorjambs are relatively thin, and screws can often be pulled out of them, especially when supporting a heavy entrance door. It may just be a simple matter of stabilizing the hinges to fix the problem with the lock.
Extend the bolt all the way, close the door and mark the positions of the top and bottom of the bolt on the jamb with a pencil. Open the door and check to see if the marks match up with the top and bottom of the strike opening.