basically give people a reason to stay in their countries and making them good places to live, while gradually trying to remove the influence of religion (through proper education etc.) - do not overthrow religious governments by force, but instead have people realize they're not the right way to go and do the change themselves
Well, first of all, I'd say that getting rid of religious influence is not really the right solution. As for the reason, it's because true religious views (Islamic, at least) don't really clash with commonly agreed morals. In fact, I've experienced and seen that religious ideas often serve as nice guidelines on the way to go with things (especially concerning leading people and such kind of community things). It's just, there are stuff religion forbids. The problem is, sometimes people forget religious restrictions are personal, and they start to try to enforce them onto others. And that is the problem we have at hand. You might not like someone's way of doing things when you compare with your religious ideas, but most you can do should be to just let them know nicely.
Moving on to (bad) Islamic governments. The problem with them is that they mostly get corrupt, at least, after a while. And corrupted religion stinks. For example, religion clearly declares theft as forbidden, but a government that steals has no issues buying a renowned imam to come up and say "In such and such circumstances, 'theft' can be accepted". While this statement is completely nonsense, that fact is ignored. In countries like Turkey (and other third world countries) educational level is rather low (surprised about Turkey maybe? So am I. Guess going to school doesn't directly prevent being a blind idiot.), and people are majorly religious. Governments know this, and they exploit it fully. The above imam statement is served as being legit. People buy it. Gradually, the government locks the country up more and takes control of the media. Whatever poop they take, is served with a cool spin. On the extra, if possible, the government adds in a clearly defined enemy, so after a while, all criticism directed at the government is seen with frowns by the people. At that point, it's either you turn into another sheep, or you escape the country somehow.
Educating such blind people who have passed their 30s sounds pretty difficult to me, if not impossible. You can't make such people realize their government is bad and just make them decide to get rid of it. Hell, especially if it's a country where votes are bought and elections are rigged... So my point is, you'll always have people running away from their countries. You can't really shorten those 200 years into 20 years, really. This generation and the one after it, at least, are gone already. You have to create a perfect education system and wait for those educated people to spread around and form a better society. Even 20 years is a time too short for that. So back to the point one more time, the problem of immigrants can't really be solved by "fixing their countries" just yet.