Realistically, only diplomacy could help. Defense treaties, etc. You want the potential threat to think twice and be deterred if they will invade, cause if you're a small ass country and youre up against a determined country, theres nothing else you can do but kowtow to your new masters. Unless youre an island nation with self sufficient food and oil and have tech superiority coupled with naval and air supremacy. Too bad our country has next to none of those aside from the island nation part.