Update examples

Update Makefile, use for loop initialization of index