Photoacoustic computed tomography (PACT) holds great promise for biomedical imaging. When the imaging system employs conventional piezoelectric ultrasonic transducers, the ideal photoacoustic (PA) signals are degraded by the transducers' acousto-electric impulse responses (EIRs) during the measurement process. If unaccounted for, this can degrade the accuracy of the reconstructed image. In principle, the effect of the EIRs on the measured PA signals can be ameliorated via deconvolution; images can be reconstructed subsequently by application of a reconstruction method that assumes an idealized EIR. Alternatively, the effect of the EIR can be incorporated into an imaging model and implicitly compensated for during reconstruction. In either case, the efficacy of the correction can be limited by errors in the assumed EIRs. In this work, a joint optimization approach to PACT image reconstruction is proposed for mitigating errors in reconstructed images that are caused by use of an inaccurate EIR. A variable projection method is employed to refine the measured EIR during the process of reconstructing the sought-after absorbed optical energy density. Computer-simulation and experimental studies are conducted to investigate the numerical properties of the method and demonstrate its value for mitigating image distortions and enhancing the visibility of fine structures.