build bam index if necessary