The Constructicons' origin would be one of the most confusing and inconsistent of the series. In "Heavy Metal War", Megatron mentions that they were built in caves on Earth. In the second season episode "The Secret fo Omega Supreme", they are shown to have existed on Cybertron and also to have been friends with Omega before Megatron converted them to the Decepticons (and it is shown that Megatron gave them the form of Devastator). Finally, in the third season's "Five Faces of Darkness", when Rodimus Prime enters the Matrix, Megatron is shown being created by the Constructicons, showing that they were evil BEFORE Megatron existed. Even more so, in the comic book, the Constructicons are shown being created by Shockwave using Optimus Prime's "Creation Matrix", and being commanded (for a time, just one issue) by Soundwave.
With all of these different origins, it's safer to accept that the Constructicons are part of Megatron's forces and to leave it at that. But, your milage may vary.