A difficulty that had to be overcome during the building of the Transcontinental railroad was Native raiding on work camps.
The appropriate response is Valley Forge. It was not the best place to set up winter camp for the Continental Army, as it was not able to shield southern Pennsylvania at the time. This area additionally left the defenseless under-provided armed force in the striking separation of the British, who were very much provisioned and secured in Philadelphia.
The reason people immigrate from one country to another is because they might have natural disasters or land and a occupation is hard to find there. So people might just be migrating to find happiness or a better life than what they had.