A 3.8 magnitude earthquake off the coast of York Harbor rattled southern Maine and was felt by people states away.