Lyapunov based attitude stabilization of an underactuated spacecraft with flexibilities