The gradient-based design optimization of mechanical systems requires robust and efficient sensitivity analysis tools. The adjoint method is regarded as the most efficient semi-analytical method to evaluate sensitivity derivatives for problems involving numerous design parameters and relatively few objective functions. This paper presents a discrete version of the adjoint method based on the generalized-alpha time integration scheme, which is applied to the dynamic simulation of flexible multibody systems. Rather than using an ad hoc backward integration solver, the proposed approach leads to a straightforward algebraic procedure that provides design sensitivities evaluated to machine accuracy. The approach is based on an intrinsic representation of motion that does not require a global parameterization of rotation. Design parameters associated with rigid bodies, kinematic joints, and beam sectional properties are considered. Rigid and flexible mechanical systems are investigated to validate the proposed approach and demonstrate its accuracy, efficiency, and robustness.