Amneal to buy generic pharmaceuticals provider AvKAR for $340m