Bifurcation of limit cycles by perturbing a piecewise linear Hamiltonian system with a homoclinic loop