Impact of flexibility on the aggregation of polymeric macromolecules