Enhancement of ion energy and flux by the influence of magnetic reconnection in foam targets