Anisotropic compact star model satisfying Karmarkar conditions