Amalgamation property for the class of basic algebras and some of its natural subclasses