Existence of global weak solutions to a generalized hyperelastic-rod wave equation with source