The program works, but curr_act prints twice in line 65-70. 
void evaluate_part2(Rule *head, Rule *rule){
    // 1. Update each of the dependencies. In other words, recursively evaluate each dependency rule.
    Dependency *curr_dep = rule->dependencies;
    while (curr_dep != NULL) {
        evaluate_part2(head, curr_dep->rule);
        curr_dep = curr_dep->next_dep;
    }

    // 2. Compare the last modified time for each of the dependencies to the target.

    // If the target does not have any dependencies, execute the rule's actions
    
    while (curr_dep2 != NULL) {
        struct stat dep_stat;
        int dep_exist = stat(curr_dep2->rule->target, &dep_stat);
        // 3. If the target does not exist, or at least one of the dependencies refers to a file with a 
        // last modified time more recent than the target, execute the rule's actions.
        struct timespec dep_time = dep_stat.st_mtim;
        
        if (target_exist != 0 || dep_exist != 0 || dep_time.tv_sec > target_time.tv_sec || \
      (dep_time.tv_sec == target_time.tv_sec && dep_time.tv_nsec > target_time.tv_nsec)) {
           
              Action *curr_act = rule->actions;
              while (curr_act != NULL) {
                int visited = 0;
                  // Execute the rule's actions
                  pid_t pid = fork();
                  if (pid == 0) {
                      
                      // Print the current action line
                      int i = 0;
                      if (visited == 0) {
                          while (curr_act->args[i] != NULL) {
                              printf("%s ", curr_act->args[i]);
                              i++;
                          }
                          printf("\n");
                          visited = 1;
                      }
                      
                      execvp(curr_act->args[0], curr_act->args);
                      fprintf(stderr, "Error: execvp failed\n");
                      exit(1);
                  }
                  } else {
                      int status;
                      waitpid(pid, &status, 0);
                      if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
                          fprintf(stderr, "Error: child process failed\n");
                          exit(1);
                      }
                  }
                curr_act = curr_act->next_act;
              }
           }
        curr_dep2 = curr_dep2->next_dep;
    }
  
}