Mind you, we have a population of 35 million people. But the size of the population doesn't matter: vote counting is an embarrassingly parallel problem.
The only explanation for election results taking a month is corruption, plain and simple. And voting machines will not solve that. Election fraud is a human problem and requires a human solution, not a technological one. If a nation cannot properly administer their own elections, then the people should insist that a third party (e.g. the UN) monitor them.
The exception in Sweden is pre-election day votes which quite easily could quite easily be tampered with if we were more corrupt.
The only reason I can see why counting the votes could take a month is to make it easier to rig the election. There is no technical reason for it.