Electromagnetic pulse generation in laser-proton acceleration from conductive and dielectric targets