Shaping the optical wavefront utilizing spatial light modulators (SLMs) is a valuable methodology for modification of a focal spot. It has numerous applications in microscopy, particularly in scattering media. Optical lithography techniques, i.e. multiphoton lithography, can also benefit from wavefront shaping. In this contribution, we present focus optimization in multiphoton lithography through a scattering medium. Beam shaping of a femtosecond-pulsed laser pulse was achieved using a liquid-crystal SLM. For the feedback system a low-cost approach, using a Raspberry Pi-camera in Bayer-mode was applied. Images of the focal spot were used as input for an evolutionary algorithm to improve focus quality.